const Route = require('../../model/route/Route')


function change(req,res){
  Route.findByIdAndUpdate(req.body.id, {
    title: req.body.title,
    tourName: req.body.tourName,
    routeDesc: req.body.routeDesc,
    startAdress: req.body.startAdress,
    endAdress: req.body.endAdress,
    time: req.body.time,
    price: req.body.price

  }, function(err,result){
    if (err) {
        res.json({
            code:0,
            msg: '更新失败'
        })
    }else{
        res.json({
            code:1,
            msg: '更新成功'
        })
    }
  })


  
}
module.exports = change